#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define USER "USER"
//"ls -a -b -c -ab -ac" --------------->长字符串
//"ls" "-a" "-b" "-c" "-ab" "-ac" 
int main()
{
    extern char** environ;
    for(int i=0;environ[i];i++)            
    {                                  
       printf("%s \n",environ[i]);        
    }  
    /*
    for(int i=0;env[i];i++)
    {
        printf("%s \n",env[i]);
    }
    if(argc != 2)
    {
        printf("EX:[ls -a -b -c -ab -ac ]\n");
    }
    if(!strcmp(argv[1] , "-a"))
    {
        printf("选择执行程序a\n");
    }
    if(!strcmp(argv[1] , "-b"))
    {
        printf("选择执行程序b\n");
    }
    if(!strcmp(argv[1] , "-c"))
    {
        printf("选择执行程序c\n");
    }
    if(!strcmp(argv[1] , "-ab"))
    {
        printf("选择执行程序ab\n");
    }
    if(!strcmp(argv[1] , "-ac"))
    {
        printf("选择执行程序ac\n");
    }
    for(int i=0;i<argc;i++)
    {
        printf("argv[%d]-> %s \n",i,argv[i]);
    }
    
    char* pwd = getenv("PWD");
    printf("my pwd = %s \n",pwd);

    char* who = getenv(USER);
    if(strcmp( who ,"root") == 0)
    {
         printf("USER: %s \n",who);
    }
    else
    {
        printf("权限不足！\n");
    }*/
    return 0;
}
